#include "myshell.h"

#include <iostream>
#include <string>
#include <stdlib.h>




//void debug()
//{
//    std::cout << "hello" << std::endl;
//}



static std::string GetUserName()
{
    std::string username = getenv("USER");
    return username.empty() ? "None" : username.c_str();
}
static std::string GetHostName()
{
    std::string hostname = getenv("HOSTNAME");
    return hostname.empty() ? "None" : hostname.c_str();
}
static std::string GetPwdName()
{
    std::string pwdname = getenv("PWD");
    return pwdname.empty() ? "None" : pwdname.c_str();
}



void PrintCommand()
{
    std::string username = GetUserName();
    std::string hostname = GetHostName();
    std::string pwdname = GetPwdName();

    printf("[%s@%s %s]&", username.c_str(), hostname.c_str(), pwdname.c_str());
}
